import React from "react";
import { Navigate } from "react-router-dom";
const Home = React.lazy(() => import("../views/home"));
const Search = React.lazy(() => import("../views/search"));
const My = React.lazy(() => import("../views/my"));
const Login = React.lazy(() => import("../views/login"));
const Tag = React.lazy(() => import("../views/tag"));
const MainLayout = React.lazy(() => import("../views/mainLayout"));
const Detail = React.lazy(() => import("../views/detail"));

export const routes = [
  {
    path: "/",
    element: <MainLayout></MainLayout>,
    children: [
      {
        path: "/home",
        element: <Home></Home>,
      },
      {
        path: "/my",
        element: <My></My>,
      },
      {
        path: "/",
        element: <Navigate to="/home"></Navigate>,
      },
    ],
  },
  {
    path: "/search",
    element: <Search></Search>,
  },
  {
    path: "/Login",
    element: <Login></Login>,
  },
  {
    path: "/tag",
    element: <Tag></Tag>,
  },
	{
    path: "/detail/:id",
    element: <Detail></Detail>,
  },
];
